/*
 * Author: nicolas.bredeche(@)lri.fr
 * Created on 20 janv. 2006
 * 
 */

package picoevo.gp.representation.mathoperators;

import java.util.ArrayList;

import picoevo.core.representation.Individual;
import picoevo.gp.representation.Element_Node_TreeGP;
import picoevo.gp.representation.Element_Node_TreeGP_Operator;
import picoevo.toolbox.Display;

public class Element_Node_TreeGP_Operator_exp extends Element_Node_TreeGP_Operator {

	public Element_Node_TreeGP_Operator_exp(Individual __individualOwner, ArrayList __elementLevelOperatorList) {
		super(__individualOwner, __elementLevelOperatorList);
		setArity(1);
		setDisplayValue("exp");
	}

	@Override
	public double evaluateDouble() {
		ArrayList list = this.getSuccessors();
		if (list.size() != 1)
			Display.error("" + getClass().getName() + "::evaluate() - incorrect number of successors (" + list.size() + ")");
		return (Math.exp((Math.abs(((Element_Node_TreeGP) list.get(0)).evaluateDouble()))));
	}

}
